package cn.smbms.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;

@ControllerAdvice//使用注解配置全局异常
public class SimpleAdvice {
    @ExceptionHandler
    public String exceptionHandler(Exception e, HttpServletRequest request) {
        request.setAttribute("e", e);
        return "error";
    }

}
